﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.Text;

namespace WxTenpay.Core.Model
{
    /// <summary>
    /// 公司管理
    /// </summary>
    public class SysCompanyEntity
    {
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
        public int Id { set; get; }
        public string GuId { set; get; } = "";
        /// <summary>
        /// 公司名称
        /// </summary>
        public string CompanyName { set; get; } = "";


        /// <summary>
        /// 添加时间
        /// </summary>
        public string CreateTime { set; get; } = "";

        /// <summary>
        /// 所在部门数据
        /// </summary>
        /// 
        [SugarColumn(IsIgnore = true)]
        public List<SysDepartmentEntity> Departmentlist { set; get; }

        /// <summary>
        /// 新增方法
        /// </summary>
        public void Create()
        {
            if (string.IsNullOrWhiteSpace(this.GuId))
                this.GuId = Guid.NewGuid().ToString();
            if (string.IsNullOrWhiteSpace(this.CreateTime))
                this.CreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
        }
    }
}
